home *** CD-ROM | disk | FTP | other *** search
- /*
- File: SampleVar.h
-
- Contains: Declarations for the various variables
-
- Copyright: © 1992 by Apple Computer, Inc., all rights reserved.
-
- */
-
- #ifndef __SAMPLEVAR__
- #define __SAMPLEVAR__
-
- #ifndef __TYPES__
- #include <Types.h>
- #endif
-
- #ifndef __SNMP__
- #include <SNMP.h>
- #endif
-
- #ifndef __TSNMP__
- #include <TSNMP.h>
- #endif
-
-
-
- /*********************************************************************************
- TSampleDirectVar
-
- This variable class is initialized with a pointer to a variable storage
- location and the size of the variable. The GetVariable, GetNextVariable, and
- SetVariable member functions will manipulate the variable storage directly
- in order to get or set the variable data.
- **********************************************************************************/
- #define kTSampleDirectVarID "snmp:var$TSampleDirectVar"
- class TSampleDirectVar : public TDevSNMPVar
- {
- public:
- TSampleDirectVar();
- virtual ~TSampleDirectVar();
- virtual OSErr InitSampleDirectVar(
- TSNMPAgent* agent, // the agent who manages the variable
- ObjectIDPtr id, // unique identifier of the variable
- short precedence, // lowest value gets responsibility
- ASNTagType type, // defines variable encoding
- SMIAccess access, // read/write, read-only, or no access
- short descResID, // resource id of description STR# resource
- short descStrIndex, // index of description string in STR# resource
- void* dataPtr,
- short dataSize);
-
- virtual OSErr GetVariable(Boolean next,ObjectIDPtr, VarBuf*);
- virtual OSErr SetVariable(ObjectIDPtr, VarBuf*, SetStage);
-
- private:
- char* fDataPtr;
- short fDataSize;
- };
-
- /*********************************************************************************
- TSampleIndirectVar
-
- This variable class is initialized with pointers to a get and a set
- function. The GetVariable and SetVariable member
- functions will call the get or set functions to perform the requested
- get or set of the variable data.
- **********************************************************************************/
- #define kTSampleIndirectVarID "snmp:var$TSampleIndirectVar"
- class TSampleIndirectVar : public TDevSNMPVar
- {
- public:
- TSampleIndirectVar();
- virtual ~TSampleIndirectVar();
-
- virtual OSErr InitSampleIndirectVar(
- TSNMPAgent* agent, // the agent who manages this variable
- ObjectIDPtr id, // unique identifier of the variable
- short precedence, // lowest value gets responsibility
- ASNTagType type, // defines variable encoding
- SMIAccess access, // read/write, read-only, or no access
- short descResID, // resource id of description STR# resource
- short descStrIndex, // index of description string in STR# resource
- GetVarProcPtr getProc,
- SetVarProcPtr setProc);
-
- virtual OSErr GetVariable(Boolean next,ObjectIDPtr, VarBuf*);
- virtual OSErr SetVariable(ObjectIDPtr, VarBuf*, SetStage);
-
- private:
- GetVarProcPtr fGetProc;
- SetVarProcPtr fSetProc; // size of the value
- };
-
- #endif __SAMPLEVAR__
-